<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-ui.js"></script>
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/jquery-ui.css" type="text/css" charset="utf-8" />

<?php if(!empty($message)) {
  echo $message;
}?>
 <div class="row-fluid">
 <div class="span1"></div>
 <form method="post" action="<?= site_url('admin/create_customer');?>">
 
     <div class="span3">
        <h4 align="center"class="heading">CUSTOMER INFORMATION</h4>
		<br>
		<label>Service ID.</label>
		<input type="text" minlength="6" required class="span6"value="<?php $id= $max_id->service_id; echo $max_id=$id+1;?>" name="service_id" id="service_id" readonly/>
		<label>Choose Date</label>
		<div id="date" class="input-append">
            <input data-date-format="yyyy/mm/dd" type="text" class="span7 date1 " id="datepicker" name ="datepicker" />
            <span class="add-on">
                <i class="icon-calendar"> </i>
            </span>
       </div>
        <label>Customer Company Name:</label>
		<input type="text"  name="company_name" id="companyName" required/>
		<span class="text-error"><?= form_error('company_name'); ?></span>
		<label>Customer Name</label>
		<input type="text"  name="contact_person" id="contactPerson"required/>
		<span class="text-error"><?= form_error('contact_person'); ?></span>
		<label> Address </label>
		<textarea rows="6" name="address" id="address" required></textarea>
		<span class="text-error"><?= form_error('address'); ?></span>
		<label>PIN Code</label>
		<input type="text"  name="pin_code" id="pinCode" required/>
		<span class="text-error"><?= form_error('pin_code'); ?></span>
		<label>Landline Number</label>
		<input type="text"  name="landline_no" id="landlineNo" />
		<span class="text-error"><?= form_error('landline_no'); ?></span>
		<label>Mobile No.</label>
		<input type="text"  name="mobile_no" id="mobileNo" required/>
		<span class="text-error"><?= form_error('mobile_no'); ?></span>
		<label>Email-ID </label>
		<input type="text" name="email_id" id="emailId" required/>
		<span class="text-error"><?= form_error('email_id'); ?></span>
		<label>Warranty Status </label>
		<select name="warranty">
		<option value="1"> Under Warranty</option>
		<option value="2"> Not Under Warranty</option>
        </select>		
		<label>Assigned To </label>
		Engineer &nbsp;&nbsp;<input type="radio" name="engineer" id="engineer_engineer"/>&nbsp;&nbsp;Admin <input type="radio" name="engineer" id="admin_engineer" checked="true" value="1"/>
		<span id="select_engineer">
		<label>Select Engineer</label>
		  <?php 
	 	$bl[0] = "Select Engineer";
	   		foreach($engineer as $engineers){
           
				$bl[$engineers->id] = $engineers->username;
			}
			echo form_dropdown('id_engineer', $bl, '', 'class="chzn-select span12" data-placeholder="Choose a Supplier" style="width:220px;"');  ?>
			</span>
			<br>

 </div>
	  <div class="span4">
        <h4 align="center" class="heading">INFORMATION FOR ENGINEER</h4>
		<br>
        <label>Model No.</label>
		<input type="text"  name="model_no" id="modelNo" required/>
		<span class="text-error"><?= form_error('model_no'); ?></span>
		<label>Product No.</label>
		<input type="text"  name="product_no" id="productNo" required/>
		<span class="text-error"><?= form_error('product_no'); ?></span>
		 <label>Serial No.</label>
		<input type="text"  name="serial_no" id="serialNo" required/>
		<span class="text-error"><?= form_error('serial_no'); ?></span>
		 <label>Password</label>
		<input type="text" name="password" id="password"required/>
		<span class="text-error"><?= form_error('password'); ?></span>
		 <label>Operating System</label>
		<input type="text"  name="operating_system" id="operatingSystem" required/>
		<span class="text-error"><?= form_error('operating_system'); ?></span>
		 <label>Country Of Purchase</label>
		 <select name="country_purchase" id="countryPurchase">
			 <?php foreach($country as $row){ 
             echo "<option value=$row->id>$row->name</option>";}?>
           </select> 
		   <span class="text-error"><?= form_error('country_purchase'); ?></span>
	  <label> Issue Reported</label>
	  <textarea rows="6" name="issue_reported" id="issueReported"></textarea>
	  <span class="text-error"><?= form_error('issue_reported'); ?></span>
	  <label> Demo Engineer Diagnosis</label>
	  	<textarea rows="6" name="demo_diagnosis" id="diagnosis"></textarea>
		<span class="text-error"><?= form_error('demo_diagnosis'); ?></span>
      </div>
	  <div class="span4">
			<h4 align="center" class="heading">CUSTOMER ACCESSORIES</h4>
			<br>
			<div class="span5">
			  <label class="checkbox">
			  <input type="checkbox" value="1"name="chk_adapter" id="chkadapter"/> AC Adapter</label>
			</div>
			  <div class="span6">
			  <input type="text" class="span12"placeholder="Enter AC Adapter Details" id="adapter" name="adapter"/>
			</div>
			<div class="span5">
			<label class="checkbox">
			<input type="checkbox" value="1"name="chk_driver" id="chkdriver"/> Driver CD</label>
			</div>
			 <div class="span6">
			 <input type="text"class="span12" placeholder="Enter DRIVER CD Details" id="drivercd" name="drivercd"/>
			</div>
			<div class="span5">
			<label class="checkbox"><input type="checkbox" value="1"name="chk_bag" id="chkbag"/> Bag</label>
			</div>
			<div class="span6">
			 <input type="text" class="span12"placeholder="Enter Bag Details" id="bag" name="bag"/>
			</div>
			<div class="span5">
			<label class="checkbox">
			<input type="checkbox" value="1"name="chk_hdd" id="chkhdd"/> HDD</label>
			</div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter HDD Details" id="hdd" name="hdd"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_powercord" id="chkpowercord"/> Power Cord</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Power Cord Details" id="power_cord" name="powerCord"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_carry" id="chkcarry"/>Carry Case Belt</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Carry Case Bag Details" id="carry_case" name="carryCase"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_optical" id="chkoptical"/>Optical Drive</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Optical Drive Details" id="optical_drive" name="opticalDrive"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1" name="chk_fax" id="chkfax"/>Fax Modem Card</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Fax Modem Details" id="fax_modem" name="faxModem"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_network" id="chknetwork"/>Network Card</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Network Details" id="network_card" name="networkCard"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_memory" id="chkmemory"/>Memory</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Memory Details" id="memory" name="memory"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox"><input type="checkbox" value="1"name="chk_capacity" id="chkcapacity"/>Capacity</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Capacity Details" id="capacity" name="capacity"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_tray" id="chktray"/>Tray</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Tray Details" id="tray" name="tray"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_battery" id="chkbattery"/>Battery</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Battery SL. NO." id="battery" name="battery"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_cradle" id="chkcradle"/>Cradle</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Cradle Details" id="cradle" name="cradle"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_fdd" id="chkfdd"/>FDD</label>
			 </div>
			 <div class="span6">
			 <input type="text"class="span12" placeholder="Enter FDD Details" id="fdd" name="fdd"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_itb" id="chkitb"/>ITB</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter ITB Details" id="itb" name="itb"/>
			 </div>
			 <div class="span5">
			 <label class="checkbox">
			 <input type="checkbox" value="1"name="chk_wireless" id="chkwireless"/>Wireless LAN</label>
			 </div>
			 <div class="span6">
			 <input type="text" class="span12"placeholder="Enter Wireless LAN Details" id="wireless" name="wireless"/>
			 </div>
		 </div>	</div>
		 <div class="row-fluid">
		 <h4 align="center" class="heading"> MISCELLANEOUS COMMENTS:</h4>
		 <div class="span4"><label> Scratches</label><textarea rows="7" name="scratches"> </textarea>     </div> <div class="span4"> <label> Damages</label><textarea rows="7" name="damage"> </textarea> </div> <div class="span3"> <label> Others</label><textarea rows="7" name="other"> </textarea> </div>
		 
         <div class="span5"></div><div class="span3"><input type="submit" class="btn btn-success " value="Save" id="caseSubmit"/></form>	</div><div class="span3"> </div>	</div>
<script>
		/* $('#caseSubmit').click(function () {	
	  if(!$('#company_name').val())
	 {
	alert('Company Name Feild is Required');	
		$('#company_name').focus();
	}
	else if(!$('#contact_person').val())
	{
	alert('Contact Person Field is Required');	
		$('#contact_person').focus();
	}
	else if(!$('#address').val())
	{
	alert('Address Feild is Required');	
		$('#address').focus();
	}
	else if(!$('#pin_code').val())
	{
	alert('Pin Code Feild is Required');	
		$('#pin_code').focus();
	}
	else if(!$('#landline_no').val())
	{
	alert('Landline No. Feild is Required');	
	$('#landline_no').focus();
	}
	else if(!$('#mobile_no').val())
	{
	alert('Mobile No  Feild is Required');	
		$('#mobile_no').focus();
	}
	else if(!$('#email_id').val())
	{
	alert('Email-id Feild is Required');	
		$('#email_id').focus();
	}
	else if(!$('#model_no').val())
	{
	alert('Model No Feild is Required');	
		$('#model_no').focus();
	}
	else if(!$('#product_no').val())
	{
	alert('Product No Feild is Required');	
		$('#product_no').focus();
	}
	else if(!$('#serial_no').val())
	{
	alert('Serial No. Feild is Required');	
		$('#serial_no').focus();
	}
	else if(!$('#password').val())
	{
	alert('Password Feild is Required');	
		$('#password').focus();
	}
	else if(!$('#operating_system').val())
	{
	alert('Operating System Feild is Required');	
		$('#operating_system').focus();
	}
	else if(!$('#country_purchase').val())
	{
	alert('Country Feild is Required');	
		$('#country_purchase').focus();
	}
	else if(!$('#issue_reported').val())
	{
	alert('Issue Reported Feild is Required');	
		$('#issue_reported').focus();
	}
	else if(!$('#demo_diagnosis').val())
	{
	alert('Demo Diagnosis Feild is Required');	
		$('#demo_diagnosis').focus();
	}
	else {
	var company_name=$('#company_name').val();
	var contact_person=$('#contact_person').val();
	var address=$('#address').val();
	var pin_code=$('#pin_code').val();
	var landline_no=$('#landline_no').val();
	var mobile_no=$('#mobile_no').val();
	var email_id=$('#email_id').val();
	var model_no=$('#model_no').val();
	var product_no=$('#product_no').val();
	var serial_no=$('#serial_no').val();
	var password=$('#password').val();
	var operating_system =$('#operating_system').val();
	var country_purchase=$('#country_purchase').val();
	var issue_reported=$('#issue_reported').val();
	var demo_diagnosis=$('#demo_diagnosis').val();
	if($('#chk_adapter').checked)
	{
	var adapter=$('#chk_adapter').val();
	}
	else
	{
	var adapter="";
	}
	var driver=$('#chk_driver').val();
	var bag=$('#chk_bag').val();
	var hdd=$('#chk_hdd').val();
	var power=$('#chk_powercord').val();
	var carry=$('#chk_carry').val();
	var optical=$('#chk_optical').val();
	var fax=$('#chk_fax').val();
	var network=$('#chk_network').val();
	var memory=$('#chk_memory').val();
	var capacity=$('#chk_capacity').val();
	var tray=$('#chk_tray').val();
	var battery=$('#chk_battery').val();
	var cradle=$('#chk_cradle').val();
	var fdd=$('#chk_fdd').val();
	var itb=$('#chk_itb').val();
	var wireless=$('#chk_wireless').val();
  $.post('<?= site_url('case_id/create_case');?>',
  {company_name : company_name , contact_person : contact_person ,address:address, pin_code : pin_code,landline_no : landline_no,mobile_no:mobile_no,email_id:email_id,model_no:model_no,product_no:product_no,serial_no:serial_no,password:password,operating_system:operating_system,country_purchase:country_purchase,issue_reported:issue_reported,demo_diagnosis:demo_diagnosis,adapter:adapter,driver:driver,bag:bag,hdd:hdd,power:power,carry:carry,optical:optical,fax:fax,network:network,memory:memory,capacity:capacity,tray:tray,battery:battery,cradle:cradle,fdd:fdd,itb:itb,wireless:wireless},

  function(data) { location.reload();
	
	 });
	}
	
	})*/</script>
<script type="text/javascript">
$(document).ready(function(){
	$('.date1').datepicker({ dateFormat: 'yy-mm-dd' });

	
})
</script>
<script>
	$(document).ready(function(){
	$("#adapter").hide(); 
	$("#select_engineer").hide(); 
	$("#drivercd").hide();
	 $("#bag").hide();
	 $("#hdd").hide();
	 $("#power_cord").hide(); 
	 $("#carry_case").hide(); 
	 $("#optical_drive").hide(); 
	 $("#fax_modem").hide();
	  $("#network_card").hide(); 
	  $("#memory").hide(); 
	  $("#capacity").hide(); 
	 $("#tray").hide(); 
	 $("#battery").hide(); 
	 $("#cradle").hide(); 
	 $("#fdd").hide(); 
	 $("#itb").hide(); 
	 $("#wireless").hide(); 
	  $('#chkadapter').click(function () { $("#adapter").toggle(this.checked);});
	    $('#engineer_engineer').click(function () { $("#select_engineer").toggle(this.checked);});
		 $('#admin_engineer').click(function () { $("#select_engineer").hide();});
	 $('#chkdriver').click(function () { $("#drivercd").toggle(this.checked);});
	 $('#chkbag').click(function () { $("#bag").toggle(this.checked);});
	 $('#chkhdd').click(function () { $("#hdd").toggle(this.checked);});
	 $('#chkpowercord').click(function () { $("#power_cord").toggle(this.checked);});
	$('#chkcarry').click(function () { $("#carry_case").toggle(this.checked);});
	$('#chkoptical').click(function () { $("#optical_drive").toggle(this.checked);});
	$('#chkfax').click(function () { $("#fax_modem").toggle(this.checked);});
	$('#chknetwork').click(function () { $("#network_card").toggle(this.checked);});
	$('#chkmemory').click(function () { $("#memory").toggle(this.checked);});
	$('#chkcapacity').click(function () { $("#capacity").toggle(this.checked);});
	$('#chktray').click(function () { $("#tray").toggle(this.checked);});
	$('#chkbattery').click(function () { $("#battery").toggle(this.checked);});
	$('#chkcradle').click(function () { $("#cradle").toggle(this.checked);});
	 $('#chkfdd').click(function () { $("#fdd").toggle(this.checked);});
	$('#chkitb').click(function () { $("#itb").toggle(this.checked);});
	$('#chkwireless').click(function () { $("#wireless").toggle(this.checked);});


 });
</script>	 
		 
		 
		 
